motto.js ➔ $   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 3
1
(function() {
2
	const mottos = [
3
		// Poor musical taste
4
		"Kids are all right",
5
		"All the good girls go to hell",
6
		"The stars look very different today",
7
		"I am exactly the person that I want to be",
8
		"Mount St. Helens is about to blow up",
9
		"The Sun is a deadly laser",
10
		"I'm just a poor boy, I need no sympathy",
11
		"My cock is much bigger than yours",
12
		// Millenial culture references
13
		"4815162342 lines of code!",
14
		"The cake was NOT a lie",
15
		"Science isn't about WHY. It's about WHY NOT.",
16
		"CATS: ALL YOUR BASE ARE BELONGS TO US",
17
		"Life is hella strange",
18
		"NO EMOJI",
19
		"There goes my burrito!",
20
		"A lock is made only for the honest man, the thief will break it", // NetHack wise
21
		"We are all now connected by the Internet, like neurons in a giant brain",
22
		"My God, it's full of stars!",
23
		"Now I am become death, the destroyer of worlds",
24
		// Local memes (you will not get it)
25
		"/a horse",
26
		"ЖЫВТОНЕ ЧО ЧО УПЯЧКА УПЯЧКА УПЯЧКА!!!",
27
		"УГ БУДЕ ПОПЯЧЕНО!!!11!!1",
28
		"МЖВЯЧНИ!11!!1",
29
		"Я ненавижу Фидонет и стремлюсь его уничтожить",
30
		"Matrix multiplication is slighty conscious",
31
		// Politics & ecology
32
		"1312",
33
		"All Cats Are Beautiful",
34
		"Those who make peaceful revolution impossible will make violent revolution inevitable",
35
		"30-50% of all species extinct by mid-century (and 70% by 2100)",
36
		"3 species now annihilated <strong>per hour</strong>",
37
		"Dirty water kills 6000 children <strong>every day</strong>",
38
		// Nonsense notifications
39
		"Now with HTML5!",
40
		"DO NOT refresh this page",
41
		"Do you trust this computer? <em>Are you sure?</em>",
42
		"You are using an outdated browser <em>(but who cares?)</em>",
43
		"This site DOES NOT use cookies. By continuing to use this site, you accept this.",
44
		"This website DOES NOT want to: know your location",
45
		"Close this page immediately to prove you are human",
46
		"You need to update your Flash Player",
47
		"You need to <a href=\"https://deletefacebook.com\" target=\"_blank\" rel=\"noopener noreferrer\">delete facebook</a>",
48
		// Misc.
49
		"Scientia potentia est",
50
		"Do a barrel roll!",
51
		"Bullshit as a service",
52
		"Don't click here!",
53
		"voltmeter, dugong, Tamil, vector, gabbro, asparagus, creativity",
54
		"'; DROP DATABASE DATABASE(); --", // gl web-scrappers
55
		"If you're reading this, you've been in a coma for almost 20 years now. We're trying a new technique. We don't know where this message will end up in your dream, but we hope it works. Please wake up, we miss you."
56
	];
57
58
	// 4:20
59
	if ((new Date()).getDay() == 3) {
60
		mottos.push("It is wednesday my dudes");
61
	}
62
63
	// my own web-framework or something, idk didn't watched JQuery
64
	function $(id) {
65
		return document.getElementById(id)
66
	}
67
68
	// absolutely not copy-pasted from stackoverflow
69
	function shuffle(list) {
70
		for (let i = list.length - 1; i > 0; i--) {
71
			let j = Math.floor(Math.random() * (i + 1));
72
			[list[i], list[j]] = [list[j], list[i]];
73
		}
74
	}
75
76
	// doing funny things
77
	function updateMotto() {
78
		let block =  $('motto');
79
		if (mottos.length > 0) {
80
			block.innerHTML = mottos.pop();
81
		} else {
82
			block.innerHTML = "No more funny texts, sorry";
83
			block.onclick = function() { return false };
84
		}
85
	}
86
87
	// this is an another useless comment
88
	shuffle(mottos);
89
	updateMotto();
90
	$('motto').onclick = updateMotto
91
})()